export default class PageBO {

    constructor() {
        this.page = 1;
        this.pageSize = 20;
    }

    /**
     * 当前页
     */
    page: number;
    /**
     * 分页大小
     */
    pageSize: number;
    /**
     * 总条数
     */
    total: number;
    /**
     * 总页数
     */
    pageCount: number;

    public convertFromList(obj: object) {
        this.page = obj.page;
        this.pageSize = obj.pageSize;
        this.total = obj.total;
        if (this.total > 0 && this.total > this.pageSize){
            this.pageCount = this.total / this.pageSize;
        }else {
            this.pageCount = 1;
        }
    }
}